package com.cskaoyan.app.controller;

import com.cskaoyan.app.bean.common.BaseRespVo;
import com.cskaoyan.app.bean.vo.statVo.AdminStatOrderGoodsVO;
import com.cskaoyan.app.bean.vo.statVo.AdminStatOrderVO;
import com.cskaoyan.app.bean.vo.statVo.AdminStatUserVO;
import com.cskaoyan.app.service.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Shuuka
 * @email 1712430536@qq.com
 * @date 2022/12/30 22:41
 */
@RestController
@RequestMapping("admin/stat")
public class AdminStatController {

    @Autowired
    AdminStatService adminStatService;

    @GetMapping("user")
    public BaseRespVo<Object> user(){
        AdminStatUserVO adminStatUserVO = adminStatService.user();
        return BaseRespVo.ok(adminStatUserVO);
    }

    @GetMapping("order")
    public BaseRespVo<Object> order(){
        AdminStatOrderVO adminStatOrderVO = adminStatService.order();
        return BaseRespVo.ok(adminStatOrderVO);
    }

    @GetMapping("goods")
    public BaseRespVo<Object> goods(){
        AdminStatOrderGoodsVO adminStatOrderGoodsVO = adminStatService.goods();
        return BaseRespVo.ok(adminStatOrderGoodsVO);
    }


}
